from flask import Flask, redirect, url_for, request, make_response
from flask_cors import CORS

from py.route.announcement import bp_an
from py.route.book import bp_book
from py.route.lend import bp_lend
from py.route.message import bp_msg
from py.route.record import bp_record
from py.route.user import bp_user

app = Flask(__name__)
CORS(app, supports_credentials=True)
app.config["SECRET_KEY"] = "renyizifuchuan"

urls = [bp_lend,bp_an,bp_record,bp_book, bp_user,bp_msg]  # 为各个路由注册
for url in urls:
    CORS(url, supports_credentials=True)
    app.register_blueprint(url)



if __name__ == '__main__':
    app.run(debug=True)
